package br.com.felix.fwt.svg.shapes;

import br.com.felix.fwt.svg.SVGBase;
import br.com.felix.fwt.svg.SVGBuilder;
import br.com.felix.fwt.svg.SVGColor;

public class SVGRectangle extends SVGBase<SVGRectangle>{

	private int width, height;
	
	private SVGColor fill;

	private float opacity;
	
	public SVGRectangle(){
		opacity = 1.0f;
	}
	
	private int rx, ry;
	
	@Override
	public void toSVG(SVGBuilder svgBuilder) {
		svgBuilder.createElement("rect")
			.x(x)
			.y(y)
			.width(width)
			.height(height)
			.attribute("fill", fill)
			.attribute("opacity", opacity)
			.endElementNoBody();
	}

	public SVGRectangle width(int width) {
		this.width = width;
		return this;
	}

	public SVGRectangle height(int height) {
		this.height = height;
		return this;
	}

	public SVGRectangle fill(SVGColor color) {
		this.fill = color;
		return this;
	}

	public SVGRectangle opacity(float d) {
		this.opacity = d;
		return this;
	}
	
	public SVGRectangle rx(int rx){
		this.rx = rx;
		return this;
	}
	
	public SVGRectangle ry(int ry){
		this.ry = ry;
		return this;
	}

	public int getRx() {
		return rx;
	}

	public int getRy() {
		return ry;
	}

}
